﻿<%@ Page Title="<%# Iudicium.Configuracion.ConfiguracionIudicium.GetApplicationName() %>" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ListaPersonasJuridicas.aspx.cs" Inherits="Personas_PersonaJuridica_ListaPersonasJuridicas" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="ui-widget-content ui-corner-all" id="marcoForm">
        <h3 id="titulo" class="ui-widget-header ui-corner-all">Administracion de Personas: Personas Jur&iacute;dicas</h3>
        <div id="content">
            <div id="toolbar_list">
                <div id="form_new">
                    <asp:HyperLink ID="NuevaPeronaHyperlink" runat="server"
                        CssClass="button"
                        NavigateUrl="~/Personas/PersonaJuridicas/FormularioPersonaJuridica.aspx"
                        Text="Nueva Persona Juridica">
                    </asp:HyperLink>
                </div>
                <asp:Panel ID="form_search" runat="server" CssClass="form_search" DefaultButton="SearchLinkButton">
                    <asp:TextBox ID="SearchTextBox" runat="server"
                        CssClass="searchField">
                    </asp:TextBox>
                    <asp:LinkButton ID="SearchLinkButton" runat="server"
                        Text="Buscar"
                        OnClick="SearchLinkButton_Click"
                        CssClass="button">
                    </asp:LinkButton>
                </asp:Panel>
            </div>
            <iudicium:Notify ID="ControlDeNotificacion" runat="server" Visible="false" />
            <div id="containerDataTable">
                <asp:GridView ID="PersonasJuridicasGridView" runat="server"
                    AutoGenerateColumns="false"
                    Width="100%"
                    CssClass="dataTable"
                    GridLines="None"
                    AllowPaging="true"
                    RowStyle-CssClass="item0"
                    AlternatingRowStyle-CssClass="item1"
                    HeaderStyle-CssClass="header"
                    DataSourceID="PersonaJuridicaDataSource"
                    OnRowCommand="PersonasJuridicasGridView_RowCommand"
                    PageSize="<%# Iudicium.Configuracion.ConfiguracionIudicium.GetGridPageSize() %>">
                    <PagerSettings PageButtonCount="10"
                        Position="Bottom" Mode="NumericFirstLast" />
                    <Columns>
                        <asp:BoundField HeaderText="Razon Social" DataField="RazonSocial" />
                        <asp:BoundField HeaderText="Nit" DataField="Nit" />
                        <asp:TemplateField ItemStyle-Width="60px">
                            <ItemTemplate>
                                <asp:LinkButton ID="EditLinkButton" runat="server"
                                    Text="Editar"
                                    CommandArgument="<%# Bind('PersonaId') %>"
                                    CommandName="EDITAR">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="60px">
                            <ItemTemplate >
                                <asp:LinkButton ID="DeleteLinkButton" runat="server"
                                    Text="Eliminar"
                                    CssClass="EliminarPersona"
                                    CommandArgument="<%# Bind('PersonaId') %>"
                                    CommandName="ELIMINAR">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        No hay personas juridicas registradas en el sistema
                    </EmptyDataTemplate>
                </asp:GridView>
                
                <asp:ObjectDataSource ID="PersonaJuridicaDataSource" runat="server"
                    TypeName="Iudicium.Persona.CRN.PersonaJuridicaCRN"
                    SelectMethod="GetPersonaJuridicaBySearch" 
                    OnSelected="PersonaJuridicaDataSource_Selected" 
                    OnSelecting="PersonaJuridicaDataSource_Selecting">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="WhereSqlHiddenField" Type="String"
                            PropertyName="Value" Name="param" />
                    </SelectParameters>    
                </asp:ObjectDataSource>
                
                <iudicium:ConfirmDialog ID="ConfirmDialog" runat="server"
                    ApplyToCssClass="EliminarPersona"  />
                <asp:HiddenField ID="WhereSqlHiddenField" runat="server" Value="1 = 1" />
            </div>
        </div>
    </div>

</asp:Content>

